<template>
  <div class="detail">
    <div class="container">
      <div class="boxies">
        <div class="box" v-if="!loadFlag">
          <video
            preload="auto"
            loop=""
            autoplay=""
            muted
            src="@images/videos/backgroundCircle.mp4"
            style="width: 100%; height: 100%; mix-blend-mode: screen"></video>
        </div>
        <div class="box" v-else>
          <video
            id="headIns"
            preload="auto"
            autoplay
            muted
            src="@images/videos/headIn.mp4"
            style="width: 100%; height: 100%; mix-blend-mode: screen"></video>
        </div>
      </div>
      <div class="box-border" :class="{ appear: loadFlag }">
        <img src="@images/jxgl/left.png" />
        <img src="@images/jxgl//right.png" />
      </div>
      <div class="box-circles" :class="{ appear: loadFlag }">
        <div class="circle-left_1">
          <div class="circle">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
          </div>
          <div class="word">
            <span class="con">{{ type === 'self' ? infoData.totalScore : infoData.orgTotalScore }}分</span>
            <span class="tip">考核得分</span>
          </div>
        </div>
        <div class="circle-left_2" @click="toWork(circleList[1])" v-if="circleList.length > 1">
          <div class="circle">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
          </div>
          <div class="word">
            <span class="con">{{ circleList[1].name }}</span>
            <span class="tip">{{ circleList[1].label }}</span>
          </div>
        </div>
        <div class="circle-left_3" @click="toWork(circleList[3])" v-if="circleList.length > 3">
          <div class="circle">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
          </div>
          <div class="word">
            <span class="con">{{ circleList[3].name }}</span>
            <span class="tip">{{ circleList[3].label }}</span>
          </div>
        </div>
        <div class="circle-right_1" @click="toWork(circleList[0])" v-if="circleList.length > 0">
          <div class="circle">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
          </div>
          <div class="word">
            <span class="con">{{ circleList[0].name }}</span>
            <span class="tip">{{ circleList[0].label }}</span>
          </div>
        </div>
        <div class="circle-right_2" @click="toWork(circleList[2])" v-if="circleList.length > 2">
          <div class="circle">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
          </div>
          <div class="word">
            <span class="con">{{ circleList[2].name }}</span>
            <span class="tip">{{ circleList[2].label }}</span>
          </div>
        </div>
        <div class="circle-right_3" @click="toWork(circleList[4])" v-if="circleList.length > 4">
          <div class="circle">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
          </div>
          <div class="word">
            <span class="con">{{ circleList[4].name }}</span>
            <span class="tip">{{ circleList[4].label }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'InfoDetail',
  components: {},
  props: {
    loadFlag: Boolean,
    type: String,
    infoData: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      test: false,
      circleList: [],
    }
  },
  computed: {},
  filters: {},
  watch: {
    infoData: {
      handler(news) {
        if (news.keyWords && news.keyWords.length) {
          this.circleList = news.keyWords
        } else {
          this.circleList = []
        }
      },
      deep: true,
      immediate: true,
    },
  },
  created() {
    setTimeout(() => {
      this.test = true
      // this.$nextTick(() => {
      //   var video = document.getElementById('headIns')
      //   video.play()
      // })
    }, 1000)
  },
  mounted() {},
  methods: {
    toWork(item) {
      // if (item.label === '绩效') return
      // let stepa = ''
      // if (item.label === '考勤') {
      //   stepa = 4
      // } else if (item.dataType === 'bonus') {
      //   stepa = 7
      // } else if (item.dataType === 'honor') {
      //   stepa = 8
      // }
      // this.$emit('toWork', stepa)
    },
  },
}
</script>

<style lang="scss" scoped>
.detail {
  width: 100%;
  height: 100%;
  position: relative;
  font-family: 'Microsoft Yahei';
  // font-size: 32px;
  color: rgb(221, 221, 221);

  .container {
    width: 100%;
    height: 100%;
    position: absolute;
    background-color: rgb(63, 91, 149);
    background-size: cover;
    background-position: center center;
    overflow: hidden;
    filter: unset;

    .boxies {
      pointer-events: none;
      position: absolute;
      top: 0px;
      left: 15%;
      width: 70%;
      height: 100%;
      display: block;
      transition: transform 600ms ease 0s, opacity 0ms ease 0s;

      .box {
        position: absolute;
        top: -25%;
        left: -25%;
        width: 150%;
        height: 150%;
        // transform: translate(-50%, -50%);
        font-size: 0px;
        mix-blend-mode: screen;
      }
    }

    .box-border {
      position: absolute;
      top: 0;
      left: 10%;
      width: 80%;
      height: 100%;
      z-index: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transform: scale(0.5);
      opacity: 0;
      transition: transform 1.5s ease 0s, opacity 0ms ease 0s;

      img {
        width: 100px;
        height: 60%;
      }
    }

    .box-circles {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      z-index: 0;
      transform: scale(0.5);
      opacity: 0;
      transition: transform 2s ease 0s, opacity 0ms ease 0s;

      .circle-left_1,
      .circle-left_2,
      .circle-left_3,
      .circle-right_1,
      .circle-right_2,
      .circle-right_3 {
        display: flex;
        flex-direction: row-reverse;
        transform: translate(-50%, -50%);
        opacity: 1;
        width: fit-content;
        // cursor: pointer;
        cursor: default;
        position: absolute;
      }

      .circle-left_1 {
        top: 15%;
        left: 25%;
      }

      .circle-left_2 {
        top: 50%;
        left: 15%;
      }

      .circle-left_3 {
        top: 85%;
        left: 25%;
      }

      .circle-right_1 {
        top: 15%;
        left: 75%;
      }

      .circle-right_2 {
        top: 50%;
        left: 85%;
      }

      .circle-right_3 {
        top: 85%;
        left: 75%;
      }

      .circle {
        position: relative;
        min-width: 70px;
        height: 70px;
        margin-left: -10px;
        margin-right: -10px;

        .circle1 {
          position: absolute;
          width: 0.5px;
          height: 0.5px;
          top: 50%;
          left: 50%;
          border-radius: 50%;
          transform: translate(-50%, -50%);
          background-color: rgba(74, 144, 226, 0.06);
        }

        .circle2 {
          position: absolute;
          width: 30px;
          height: 30px;
          top: 50%;
          left: 50%;
          border-radius: 50%;
          transform: translate(-50%, -50%);
          background-color: rgba(74, 144, 226, 0.2);
        }

        .circle3 {
          position: absolute;
          width: 15px;
          height: 15px;
          top: 50%;
          left: 50%;
          border-radius: 50%;
          transform: translate(-50%, -50%);
          border: 3px solid rgb(52, 233, 229);
        }
      }

      .word {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-end;
        font-size: 16px;
        max-width: 100px;

        .con {
          color: rgb(220, 240, 255);
        }

        .tip {
          color: rgb(110, 177, 255);
        }
      }

      .circle-right_1,
      .circle-right_2,
      .circle-right_3 {
        flex-direction: row;

        .word {
          align-items: flex-start;
        }
      }
    }

    .appear {
      transform: scale(1);
      opacity: 1;
    }
  }
}
</style>
